﻿<UserControl x:Class="MetroDemo.ExampleViews.DateExamples"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:MetroDemo="clr-namespace:MetroDemo"
             xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
             mc:Ignorable="d"
             d:DesignHeight="600"
             d:DesignWidth="800"
             d:DataContext="{d:DesignInstance MetroDemo:MainWindowViewModel}">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <AdornerDecorator>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Text="date picker"
                           Margin="0,5"
                           FontSize="20"
                           HorizontalAlignment="Center" />
                <DatePicker Width="150"
                            HorizontalAlignment="Center"
                            Controls:TextboxHelper.Watermark="Select a date" />
                <DatePicker Width="300"
                            Margin="2"
                            FontSize="24"
                            HorizontalAlignment="Center"
                            SelectedDate="{Binding DatePickerDate, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}"
                            Controls:TextboxHelper.Watermark="Select a date" />
            </StackPanel>
            <StackPanel Grid.Row="1"
                        Grid.Column="0">
                <TextBlock Text="disabled date picker"
                           Margin="0,5"
                           FontSize="20"
                           HorizontalAlignment="Center" />
                <DatePicker Width="150"
                            HorizontalAlignment="Center"
                            Controls:TextboxHelper.Watermark="Select a date"
                            IsEnabled="False" />
            </StackPanel>
            <StackPanel Grid.Row="0"
                        Grid.Column="1">
                <TextBlock Text="calendar"
                           Margin="0,5"
                           FontSize="20"
                           HorizontalAlignment="Center" />
                <Calendar />
            </StackPanel>

            <StackPanel Grid.Column="1"
                        Grid.Row="1">
                <TextBlock Text="disabled calendar"
                           Margin="0,5"
                           FontSize="20"
                           HorizontalAlignment="Center" />
                <Calendar IsEnabled="False" />
            </StackPanel>
        </Grid>
    </AdornerDecorator>

</UserControl>
